package org.wzh.demo.git;

public abstract class Pet {

    protected String name;
    protected int age;
    protected Person master;
    protected Department department;

    public Pet(String name, int age, Person master, Department department) {
        this.name = name;
        this.age = age;
        this.master = master;
        this.department = department;
    }

    public abstract void speak();

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public int getAge() {
        return age;
    }

    public void setAge(int age) {
        this.age = age;
    }

    public Person getMaster() {
        return master;
    }

    public void setMaster(Person master) {
        this.master = master;
    }

    public Department getDepartment() {
        return department;
    }

    public void setDepartment(Department department) {
        this.department = department;
    }

    @Override
    public String toString() {
        return "Pet{" +
                "name='" + name + '\'' +
                ", age=" + age +
                ", master=" + master +
                ", department=" + department +
                '}';
    }
}
